C (15/301)

From:Ben Hutchings
Date:04 Aug 99 at 00:40:22
Subject:Re: Re: (no subject)

From: Ben Hutchings <womble@zzumbouk.demon.co.uk>

On Mon, Aug 02, 1999 at 12:28:19AM -0400, Gregory Roberts II wrote:
> From: Gregory Roberts II <gregr@en.com>
>
> On Sun, 1 Aug 1999, Allan Odgaard wrote:
>
> > From: Allan Odgaard <Duff@DIKU.DK>
> >
> > On 31-Jul-99, Gregory Roberts II wrote:
> >
> > > [...]
> > > A shared library is just that: shared by many processes. Therefore, it
> > > doesn't have the context that dos.library needs to operate.
> >
> > I don't think this is entirely true. A library function should be viewed as an
> > extension of a program, thus has the process-structure of the calling program.
> > So most DOS functions are callable from a library, granted that library has
> > been called from a process, even though many DOS functions can actually be
> > called by tasks.
>
> You're right. Usually you can get away with it because libraries are
> almost always called by Processes, so dos.library just uses the calling
> process. I can't say whether most DOS functions can be called by tasks.
> The rule I always heard was that you must be a process to call
> dos.library, and to do anything else wasn't system-friendly.
<snip>

AllocDosObject, CreateNewProc, DoPkt, and SendPkt are documented as
being callable from plain tasks.

The difference between a process and a plain task is in the context
information which is required by most DOS functions. The fact that
this context is optional makes AmigaOS rather unusual (I think).



Ben Hutchings - womble@zzumbouk.demon.co.uk, http://www.zzumbouk.demon.co.uk
Team *AMIGA* | Jay Miner Society | Linux - the choice of a GNU generation
Humour is the best antidote to reality.